package com.diaohw.module.system.obj.mapstruct;

import com.diaohw.module.system.obj.dto.MenuDto;
import com.diaohw.module.system.obj.entity.Menu;
import com.diaohw.module.system.obj.vo.MenuTreeVo;
import com.diaohw.module.system.obj.vo.MenuVo;
import com.diaohw.platform.remote.auth.obj.bo.MenuBO;
import org.mapstruct.IterableMapping;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * <p>
 * 菜单 类型转换
 * </p>
 *
 * @author D-Hw
 * @since 2024-07-05
 */
@Mapper
public interface MenuMapstruct {

    MenuMapstruct INSTANCE = Mappers.getMapper(MenuMapstruct.class);

    /**
     * dto to entity
     */
    Menu dtoToEntity(MenuDto dto);

    /**
     * entity to dto
     */
    MenuDto entityToDto(Menu entity);

    /**
     * entity to Vo
     */
    MenuVo entityToVo(Menu entity);

    @IterableMapping(elementTargetType = MenuVo.class)
    List<MenuVo> entityToVo(List<Menu> list);

    @IterableMapping(elementTargetType = MenuVo.class)
    List<MenuTreeVo> entityToTree(List<Menu> list);
    @IterableMapping(elementTargetType = MenuVo.class)
    List<MenuBO> entityToTreeBo(List<Menu> list);



}

